package com.sy.learn;

import java.time.Period;

/**
 * 成员方法传参机制
 */
public class java_0213 {
    public static void main(String[] args) {
        People p = new People();
        p.age = 10;
        p.name = "Jack";

        Change change = new Change();
        change.test(p);
        System.out.println(p.age);

        change.test2(p);
        System.out.println(p.age);
    }
}

class People {
    public void People() {
    }

    String name;
    int age;
}

class Change {
    public void test(People p) {
        p.age = 20;
    }

    public void test2(People p) {
        p = null;
    }
}
